package huYa

import (
	"answer4/adb"
	"answer4/unti"
	"encoding/xml"
	"fmt"
	"io/ioutil"
)

var(
	question unti.Question
)
func Start(){
	adb.Restart()
}
func DumpQuestion(){
	content, _ := ioutil.ReadFile(`D:\DownLoad\MEmu\ui.xml`)
	//decoder := xml.NewDecoder(bytes.NewBuffer(content))
	var data Hierarchy
	xml.Unmarshal(content, &data)

	fmt.Println(data.Nodes[0].Nodes[1].Nodes[0].Nodes[1].Nodes[1].Text)
	question.Round = 1
	question.Title="数学符号Rt△，所代表的意义是什么？"
	question.Options = []unti.Option{unti.Option{Text:"锐角三角形"},unti.Option{Text:"直角三角形"},unti.Option{Text:"钝角三角形"}}
	unti.NewQuestion(&question)
}

type Hierarchy struct {
	XMLName xml.Name `xml:"hierarchy"`
	Nodes []Node `xml:"node"`
}
type Node struct {
	Nodes []Node `xml:"node"`
	ResourceId string `xml:"resource-id,attr"`
	Text string `xml:"text,attr"`
	ContentDesc string `xml:"content-desc,attr"`
}